While researchers still aren’t sure why we have nightmares, a theory is they provide a safe, low-stakes space to work through difficult emotions or situations that might be troubling us in waking life, reports New York magazine.

This might explain why I keep having the same recurring dream. “Generally speaking, we dream about whatever it is that is going on in our lives as we are falling asleep, or it’s the most prevalent stressful situation that’s going on in our world,” explains psychologist and sleep specialist Michael Breus. “If you have a situation where you are thinking about something that is very, very stressful on a fairly regular basis, then it will show up as a dream or in your unconscious.” And that same dream can replay over and over again during stressful periods.