Do you toss and turn at night? Odds are, it’s not because you had spicy food or saw “Paranormal Activity” right before bed. It may be because you’re lonely.

University of Chicago scientists asked a group of adults to complete questionnaires that gauged their loneliness. With questions like, “How often do you feel isolated?” and “Do you feel sleepy during the day?” Then, to test their sleep patterns, volunteers wore a wristwatch-like device for one week called an actigraph, which digitally recorded their every move. Scientists could tell when they were asleep if the device didn’t move for at least 10 minutes.

The result? Lonely people frequently tossed and turned and would often wake up and not be able to fall back asleep for hours. On the flip side, people who felt well-connected to others, and had lots of friends, slept more soundly every night.

So, why does loneliness cause a bad night’s sleep? Researchers believe it’s because feeling sad and isolated causes your mind to race. With thoughts like “All of my friends have girlfriends, I wish I had one, too," the brain’s so busy buzzing that it’s impossible to fall asleep.

So, what’s the fix? Widen your social circle. Japanese researchers found that people who have regular social interactions are 250% less likely to struggle with insomnia.

So, volunteer, take a class, or join a sports league.