After the stock market meltdown of 2007 and 2008, many Americans grew wary of investing and moved more of their savings into money market deposit accounts. These have less volatility than stocks and a higher return rate than traditional savings accounts.

In fact, the total amount in money market accounts has nearly doubled since the stock market crash, from around $2.7 trillion at the end of 2007 to more than $5.1 trillion as of this June, according to data from the Federal Deposit Insurance Corp.

Trading the volatility of stocks for the safety of a money market account might sound like a good idea, but many financial advisors believe that putting long-term savings, such as retirement savings, into money market accounts — and forgoing the better long-term returns of the stock market — could cost Americans plenty.

Money market accounts usually return 1% or less, which is lower than the rate of inflation. That means people are essentially losing money they’re hoping will ease them through their retirement years.

We asked Anna Sergunina of MainStreet Financial Planning to explain how money market accounts may be hurting consumers and what they should be doing instead. Anna is a member of NerdWallet’s Ask an Advisor network.

Are people costing themselves money by putting their retirement savings in money market accounts?

Yes. Money market accounts are good places to park your short-term money, but these accounts are paying very low returns, 1% per year if you are lucky. With inflation at 3% or more per year, you won’t be able to make your savings stretch very far. That’s where stock and bond market investing comes in handy. It helps you stay ahead of inflation.

Are there some cases where you should keep your money in money market accounts?

Yes, but only if you plan to be using the money in the next year or two. This way you can avoid any short-term market fluctuations and the potential loss of principal.

It’s best to think about your financial goals: Are you planning to buy a car in the next few months? Are you going to do a home remodel next year? Are you going to take a costly vacation soon? If the answer to these questions is yes, putting money in a money market account is a good idea, because you wouldn’t want to see that money shrink due to a bad month for the stock market.

You can also use a money market account as the place where you keep your emergency fund. This is the place where you want to keep at least three months of expenses to pay for any unforeseen costs that come up, like car repairs. Money markets are liquid, so you can easily withdraw this money when it’s needed.

» MORE: Here are the best money market accounts

What would you tell cautious investors who think the stock market is dangerous?

The stock market is not a dangerous place if you have the right strategy in place. The key thing to know about the stock market is that it needs time — time to work for you and time for your money to grow. Historically, the stock market grows an average of around 7% per year. But that doesn’t mean it grows that much every year. For this reason, we recommend investing more money in the stock market when it is for long-term goals such as retirement savings, because then you’re giving it time to grow, and you can ride out the ups and downs.

Are there any other investing tips people should keep in mind?

I like the idea of a “buckets of money” approach for investing. Think of your savings vehicles as short term (one to three years), medium term (three to seven years) and long term (seven years or more).

In your short-term bucket, you should only have “safe,” FDIC-insured investments such as savings accounts and money market accounts. Your medium-term bucket can include some stocks and bonds to generate more return, since three to seven years should be enough time to capture the upside of the stock market. For your long-term bucket, you definitely need to have significant stock-market exposure. Your goal is to help your money grow so that it lasts longer and beats inflation.

Anna Sergunina is a financial advisor, the owner of MainStreet Financial Planning, and creator of the Money Library platform. MainStreet has offices in California, Maryland, New York and Washington, D.C.

The article Money Market Accounts Could Drag Down Your Retirement Savings originally appeared on NerdWallet.