A new study suggests that joining a religious group could do more for someone’s “sustained happiness” than other forms of social participation, such as volunteering, playing sports or taking a class.

A study in the American Journal of Epidemiology by researchers at the London School of Economics and Erasmus University Medical Center in the Netherlands found that the secret to sustained happiness lies in participation in religion.

“The church appears to play a very important social role in keeping depression at bay and also as a coping mechanism during periods of illness in later life,” Mauricio Avendano, an epidemiologist at LSE and an author of the study, said in a statement. “It is not clear to us how much this is about religion per se, or whether it may be about the sense of belonging and not being socially isolated.”

Researchers looked at four areas: volunteering or working with a charity; taking educational courses; participating in religious organizations and participating in a political or community organization.

Of the four, participating in a religious organization was the only social activity associated with sustained happiness, researchers found. The study analyzed 9,000 Europeans who were over the age of 50.

The report also found that joining political or community organizations lose their benefits over time. In fact, the short-term benefits from those social connections often lead to depressive symptoms later on, researchers say.

Although healthier people are more likely to volunteer, the researchers found no evidence that volunteering actually leads to better mental health. Benefits could be outweighed by other negative impacts of volunteering, such as stress, Avendano said.

The researchers noted that it is unclear whether the benefits of participating in a religious organization are connected to being in the religious community or to the faith itself.