Millennials are often labeled as being financially irresponsible, but they may be in better financial shape than other generations, according to the Generations Ahead Study from Allianz Life Insurance Company.

The study found that 77% of millennials feel financially confident, as opposed to just 64% of the Generation Xers that come before they.

41% of millennials reported they always set aside money each month for saving (compared to only 36% of Gen Xers) and 58% believe saving for retirement is a basic necessity, like food or housing.

Millennials (71%) also use “tricks” to make saving money easier. They may use several different accounts to save money for specific purposes – one for everyday expenses, one for a particular loan, one for a special trip.

However, the study showed that social media has become the millennials’ financial Achilles’ heel. More than half (55%) reported experiencing a fear of missing out (FOMO) and 57% spent money they hadn’t planned to because of what they saw on their social media feeds.

“Millennials are finding innovative ways to build their financial strength and are becoming more confident because of these actions,” said Paul Kelash, vice president of Consumer Insights for Allianz Life. “But, more than any other generation, social media and the allure to spend beyond their means could have long-term negative effects on their finances if they’re not careful.”

Millennials are also haunted by the experiences of their parents. Nearly a quarter (24%) of millennials saw their family suffer a major financial setback during the recession of 2008/09 and 57% said they are unlikely ever to invest in the stock market. Additionally, 65% are uncomfortable with too much debt because they saw their parents struggle with it.

“While it’s promising that many millennials are working to avoid debt and build savings, seeing such a large number of them averse to investing is a concern,” added Kelash. “A balanced approach to saving and investing is a strong recipe for a solid retirement and if they have worries, a financial professional can help them find the right balance.”