Exchange-traded funds have soared in popularity over the past decade…but more and more are shutting down now, and not always in ways that are friendly to their shareholders. A record 128 ETFs—about 6% of all those offered—shut down last year, including 14 from the best-known ETF brand, BlackRock iShares.

ETFs are closing because it has become difficult for many of them to stand out and profit among the nearly 2,000 that existed at the end of 2016. But even if an ETF shuts down, it doesn’t mean that your shares plunge in value or become worthless. Investors generally receive cash distributions equal to the value of the underlying shares of stocks held by the ETF, although it can take as long as 10 business days to get your money back after the ETF liquidates its investments.

Drawbacks: In taxable accounts, you may owe capital gains tax, which can be hefty if your ETF has gained a lot since you invested in it. Investors who hold shares until liquidation could, in rare cases, be hit with last-minute termination fees, although major ETF providers such as BlackRock, State Street and Vanguard cover these costs.

What to do if your ETF will liquidate: Expect a notice from your ETF about one to two months before the liquidation date, which is specified in the notice. Sell your shares before the liquidation date to avoid possible termination fees and a possible delay in getting your cash. If you are considering investing in ETFs in the future or have invested in one, be aware of factors that may indicate a possible shutdown, including small portfolio assets (less than $50 million)…a short track record (less than three years)…low share liquidity (average trading volume of less than 50,000 shares a day over the past month).