The Netherlands Institute for Neuroscience published new research in the journal Brain that found that people with insomnia can’t get rid of emotional distress. The researchers’ findings show that one of the causes of insomnia might be related to brain circuits in the brain that regulate emotions.

The researchers took MRI scans of participants’ brain activities while they thought about their most embarrassing experiences that happened decades ago, according to the news release. The people who slept well were able to “neutralize” those memories, the news release said, while the people who experienced insomnia couldn’t do the same. The researchers say their findings might suggest insomnia could be caused by the inability to quell emotional distress, which could explain why insomnia is one of the leading risk factors for developing mood disorders, anxiety, and post-traumatic stress disorder, according to the news release.

“Sayings like ‘sleeping on it’ to ‘get things off your mind’ reflect our nocturnal digestion of daytime experiences,” Rick Wassing, first author of the study, said in the news release. “Brain research now shows that only good sleepers profit from sleep when it comes to shedding emotional tension. The process does not work well in people with insomnia. In fact, their restless nights can even make them feel worse.”

The brain imaging shows that one of the causes of insomnia might be brain circuits in the brain responsible for regulating emotions, the news release says, and these circuits contain risk genes for insomnia that might not always activate properly during rapid eye movement (REM) sleep. “Without the benefits of sound sleep, distressing events of decades ago continue to activate the emotional circuits of the brain as if they are happening right now,” the researchers said.