I think we can all agree that dreams are pretty cool. They give us the power to fly and the ability to talk to animals—they’re a way of experiencing our deepest desires. And we’re often pretty bummed when we wake up from them. Nightmares, on the other hand, are hated by all and beloved by none. They channel our biggest fears and display them as a cinema in our minds, until we’re jolted awake by our survival instincts or a worried friend. They leave us with racing hearts, quickened breathing, and fearful minds.

Now, I’m one of those people who dreams consistently and remembers those very dreams the next morning—which is, for the most part, pretty awesome. I get to reflect on and laugh at the funny storylines of my consciousness. This is not, however, the least bit awesome when I have nightmares. A few years ago I had a nightmare almost every night for three weeks. Needless to say, I was pretty shaken up by the end of it. I experienced bouts of anxiety and certainly didn’t feel like my normal self—which isn’t abnormal in those who have a lot of nightmares. It in fact, gets a lot worse.

A new study “Nightmares and nonsuicidal self-injury: The mediating role of emotional dysregulation” from Florida State University says that nightmares are associated with an increased risk of self-harming behaviors. These findings align with previous research that shows there is a link between sleep problems—such as nightmares and insomnia—and suicide attempts. “We’re seeing sleep disturbances linked to so many psychological disorders, including depression and suicide,” says Chelsea Ennis, lead author of the study and FSU psychology doctoral students. Nightmares, however, were the only sleep disturbance related to self-injury, she explains.

To test this link between nightmares and self-injury, Ennis analyzed data from two groups of people: patients at FSU’s Psychology Clinic and undergraduate students. She noticed the connection between nightmares and self-injury in both samples. Other sleep problems, however, did not appear to be connected to nonsuicidal injury. “Dreams function to regulate and process our emotions, so when we have nightmares we are not processing properly,” she explains. “It’s a breakdown of what is supposed to happen in our emotional regulation process.”

This failure to correctly confront negative feelings can trigger angry outbursts, aggression, serious changes in mood, and otherwise harmful behaviors, which can raise the risk of self-injury. Ennis wondered if this emotional dysregulation could explain the link she found between nightmares and self-injury. And after putting it to the test, found that her hypothesis was correct. The study found that people who had more intense and frequent nightmares had a 1.1 times higher risk of self-injury. And while this is a rather small effect, another much larger study found comparable results and an even larger risk.

Ennis understands recurrent, vivid nightmares can be rather problematic for the person experiencing them: “If you have an upsetting nightmare once a week, that’s likely not problematic. But if nightmares start to interfere with your sleeping to the point where you’re afraid to go to sleep or you feel like you’re not getting adequate rest, that’s when it is a problem.” She goes on to list effective treatment options for nightmares and other sleep problems such as cognitive behavioral therapy.

Luckily, my recurrent nightmares finally ended after a few ill-fated weeks. At first, I refused to believe they could be due to built-up anxiety or avoidance of my feelings, but it ended up being exactly that. I had been pushing all of my negative emotions to the back of my mind, in hopes of avoiding them forever. But, as it turns out, I was forced to confront them every night until I finally acknowledged their existence.

Florida State University “Link Between Nightmares and Self Harm.” NeuroscienceNews. NeuroscienceNews, 2 November 2017. <http://neurosciencenews.com/nightmare-self-harm-7854/>.

“Nightmares and nonsuicidal self-injury: The mediating role of emotional dysregulation” by Chelsea R. Ennis, Nicole A. Short, Allison J. Moltisanti, Caitlin E. Smith, Thomas E. Joiner, and Jeanette Taylor in Comprehensive Psychiatry. Published online April 18 2017 doi:10.1016/j.comppsych.2017.04.003