Social media has facilitated both new ways of connecting with others and new ways of tallying how our lives stack up against theirs. In the twenty-first century, keeping up with the Joneses has become keeping up with the hundreds of people on your Facebook feed.

Several previous studies have suggested that comparing yourself with others on social media means setting yourself up for negative mental health consequences, most notably in areas like self-esteem. After all, the lives other people present virtually are selective and often idealized, so if you compare those images to your own messy life, you’re likely to come up short.

Now, a study from researchers in China adds evidence for a link between comparisons via social media and mental health risks, with an emphasis on the role of envy.

Unlike previous studies, which have generally looked at social media use among teens and college students, this study surveyed married adults. It asked them about their tendency to engage in upward social comparisons using social media by seeing how much they agreed with statements like “I often like to compare with people who do better than I do.”

It turned out that people who engaged in more social comparisons with people they perceived as “doing better” than them had higher rates of depression. Statistically, the link between upward social comparisons and depression was explained entirely by people’s levels of envy, indicating that this emotion in particular might account for some of social media’s negative mental health effects.

The researchers also found that the quality of people’s marriages determined how extensive the negative impact of social comparisons tended to be. When people perceived their marriages as going well, they tended to be less affected by making upward social comparisons with others via social media.

For all of us, married or not, the results are a good reminder that what we use social media for matters. Using it to build connections with others and stay in touch with people is probably something that enriches our lives, but using it to make direct comparisons between our lives and others’ might carry significant risks for our happiness and wellbeing.