One third of young people who left organized religion did so because of anti-gay teachings or treatment within their churches, according to a new study.

While not surprising—it’s no secret that younger Americans are more accepting of gay people—it puts a number on the cost anti-gay policies can have on organizations.

A full 31% of young people (ages 18 to 33) who left organized religion said “negative teachings” or “negative treatment” of gay people was a “somewhat important” or “very important” factor in their departure, as surveyed by the Public Religion Research Institute.

A strong majority (58%) of Americans also said religious groups are “alienating” young people by “being too judgmental on gay and lesbian issues.” A full 70% of young people said the same.

Last year, Pope Francis made headlines when he famously said “who am I to judge?” of gay priests, signaling a more tolerant and aware tone to the Catholic Church.

Do you think churches will change their policies on gays and lesbians to appeal to younger people?

Religious organizations aren’t the only ones struggling to retain young people over gay rights—the Republican Party has also struggled to reconcile its socially conservative Christian wing with its desire to attract young folk.

In the wake of the 2012 election—lost in part due to young people’s overwhelming votes for the president—Republican National Committee Chairman Reince Priebus advised his party not to “act like Old Testament heretics” on the issue. Republicans “have to strike a balance between principle and grace and respect,” he said.

Republicans are still struggling to find that balance: GOProud, the gay conservative group, was once again forbidden from hosting a table at the Conservative Political Action Conference this year.