Distractions are always a waste of time, but they don’t always derail your train of thought. A new study from the Beckman Institute at the University of Illinois at Urbana-Champaign has found that how your brain responds to a distraction depends on how you respond to it emotionally. The better the feeling, the better it is for you.

The researchers knew from previous studies that negative distractions — say, a snippy Slack notification from a coworker — disrupt the ability to focus. But in the current study, recently published in the journal Cerebral Cortex, they explored the effects of positive distractions — a sudden delivery of free pizza, for example — on the brain. Welcome interruptions, they found, were actually associated with better brain performance.

In the study, led by assistant professor of psychology Florin Dolcos, participants were shown a series of faces and, after a short delay, asked to recall certain ones. During the delay, they were shown positive, negative, or neutral images, which served as emotional distractions. The positive distractions, surprisingly, didn’t interfere with working memory; while they grabbed participants’ attention, the interruptions didn’t interfere with their ability to complete the task at hand. Compared to the negative distractions, the authors suggested in a release, positive distractions might actually improve follow-through.

While the mechanism behind this phenomenon isn’t clear, MRI scans of distracted participants’ brains offered some explanations. Negative distractions reduced activity in the brain regions associated with working memory and attention, so it makes sense that they make completing tasks harder. Positive distractions, on the other hand, had less of an effect in those regions and increased activity in the brain region that deals with emotional control. Coping effectively with distractions, it seems, requires emotional engagement.

The authors hope that identifying the parts of the brain involved with positive and negative responses to distractions will ultimately lead to more targeted treatments for emotional disorders, like depression and anxiety.

Photos via Getty