Don’t worry, be happy. That sounds like good advice — and it’s clear that positive emotions are linked to better health — but we all know that occasional feelings of sadness or anger are inevitable. The good news is that bad moods may have benefits of their own.

Research by Dr. Joe Forgas, professor of psychology at the University of New South Wales in Australia, suggests that periods of low mood can increase attention, boost short-term memory and enhance our communication skills.

“In this way, mild, temporary negative moods can be helpful in coping, and their health benefits lie in allowing us to cope better, and adapt to mildly challenging situations,” Forgas told The Huffington Post in an email. “Of course, this does not always work, and when negative mood becomes intense and long-lasting, as is the case in depression, this can produce serious handicaps for coping.”

“Mood states have an important evolutionary signalling function, preparing the organism to respond appropriately to various environmental conditions,” Forgas said in the email. “In a sense, good moods signal that the situation is safe, familiar and that existing responses are appropriate. Negative mood in turn signals that the situation is new, challenging and the greater attention to new information is required to produce an effective response.”

Well, bad mood generally is not a good thing, especially when allowed to linger.