You put your two weeks in, and you begin to feel giddy, more lighthearted than you’ve felt in years. The moment you step out of your dreaded office on your last day of work, songs of jubilation fill your mind; you can’t stop yourself from giggling and gasping, “I’m free! I’m free!”

Fast forward to several weeks later, and the idea of quitting your job without another one lined up — because you wanted a career change or because you were miserable — doesn’t feel so solid anymore. In fact, your “funemployment” has quickly deteriorated into a state of being broke, unshaven, and panicky. You have all the hours in the day to do things and apply to jobs, yet you find that with each passing day your motivation wanes.

Long-term unemployment might give you a chance to regroup and reinvent yourself — it also offers creatives a tantalizing opportunity to focus entirely on their art. But unemployment also comes with a slew of health issues, from an increased risk of suicide to higher prostate cancer mortality rates. Now, a new study examines this link further, delving into why unemployment can take a toll on mental health.

The study, published in the Journal of Child Psychology and Psychiatry and conducted by researchers at King’s College London, Duke University, and the University of California, found that young people who weren’t in school, working, or in training were far more vulnerable to mental illness than people who were on track in some sort of way. The researchers used data from the Environmental Risk Longitudinal Twin Study, which examines over 2,000 young British people in the transition period between school and career.

The researchers referred to the unemployed group as NEET, which stands for “not in education, employment, or training.” Sixty percent of NEET young people had experienced one or more mental health problems during their childhood when compared to only 35 percent of non-NEET young people. In addition, 14 percent of NEET young people had generalized anxiety disorder, compared to 6 percent of non-NEET people.

Interestingly, however, a higher risk of mental illness among NEET people did not necessarily mean less motivation. In fact, the researchers found the opposite: Unemployed people actually reported having higher commitment to the idea of work.

“Our findings indicate that while the struggle to find work appears to take its toll on the mental health of young people, this does not appear to be an issue of motivation,” said Professor Terrie Moffitt, an author of the study, in a press release. “The majority of 18-year-olds we spoke to were endeavoring to find jobs and committed to the idea of work, although they are perhaps hampered by a lack of skills that would serve them well in the job market.”

The researchers aren’t entirely sure what makes unemployed people more likely to have experienced mental health issues in the past. In many ways, the stress and mental illness that comes along with unemployment can add to a vicious cycle, where employers are less likely to hire someone who doesn’t seem entirely healthy or stable.

The study is just an addition to a large body of evidence that shows how damaging long-term unemployment can be to someone’s confidence and mental health — and ultimately their physical health. One recent study found that unemployed prostate cancer patients are more likely to die compared to employed patients. Another study found that unemployed people who were jobless for a long time underwent personality changes that made them less agreeable and conscientious.

But perhaps before we judge someone for being lazy and not having a job, let’s remember that if mental illness is involved, the situation is always far more complicated.

“Young people who are neither working nor studying are often assumed to be unmotivated or unwilling to work, yet our study suggests that they are just as motivated as their peers — but many face psychological challenges that put them at a disadvantage when seeking employment,” said Professor Louise Arseneault, an author of the study, in the press release. “It is crucial that young people are better supported by mental health services as they make this challenging transition from school to employment, and that they be trained in professional ‘soft’ skills, which could help them in the search for employment.”

Source: Goldman-Mellor S, Caspi A, Arseneault L, Ajala N, Ambler A, Danese A. Committed to work but vulnerable: self-perceptions and mental health in NEET 18-year olds from a contemporary British cohort. The Journal of Child Psychology and Psychiatry. 2015.