For individuals struggling with depression, staying positive is a life-long battle that only seems to get more difficult with each relapse. A new study in Biological Psychiatry found that the way negative thoughts are managed can actually predict a person’s likelihood of a relapse.

Researchers found that people with depression who stew over negative thoughts are likely to become depressed again, whereas people who accept negative thoughts are less likely to relapse. The reason for this, researchers said, is because different parts of the brain are activated by each mindset. Ruminating over negative thoughts activates the frontal cortex, but responding with acceptance allows the visual areas in the back of the brain to come into effect.

For the study, researchers took pictures of the brain activity of 16 formerly depressed patients while they watched sad scenes from movies. Over the next year and a half, nine of the 16 patients relapsed into depression, and those who did showed more activity in the frontal region of their brain, which is linked to dwelling on negative events.

The patients who didn’t relapse had more active rear portions of the brain, which is responsible for processing visual information. It is linked with feelings of acceptance and not judging experiences.

“Despite achieving an apparent recovery from the symptoms of depression, this study suggests that there are important differences in how formerly depressed people respond to emotional challenges that predict future well-being,” said author Dr. Norman Farb in an Elsevier press release. “For a person with a history of depression, using the frontal brain’s ability to analyze and interpret sadness may actually be an unhealthy reaction that can perpetuate the chronic cycle of depression.”