A bill that would allow state-licensed professionals to refuse to serve LGBTQ people if they cite their religion has advanced out of committee in the Texas senate.

Senate Bill 17 would prevent state licensing agencies from denying or revoking licenses from professionals – including doctors, lawyers, pharmacists, and even barbers – if they claim to be following a “sincerely held religious belief.”

“Living our faith does not stop when we start to work,” said state senator Charles Perry (R), who authored the bill.

“When we see what we may perceive as immoralities, those people who hold those beliefs should be able to defend their faith… without fear of losing their livelihood and their license.”

Related: Texas Republican introduces bill to make discrimination against LGBTQ people legal

SB 17 has an exception for life-or-death situations, where doctors and other medical professionals would be required to provide treatment no matter what. Law enforcement officers are not included in the bill.

Since the state has no right under the First Amendment to question someone’s professed religious belief, opponents of the bill said at a hearing yesterday that it could be a slippery slope to allow pretty much any sort of unprofessional behavior.

“Love does not withhold care for those in need because of a difference in belief,” said Revered William Knight of the Metropolitan Community Church of San Antonio.

Rabbi Nancy Kasten said that religious beliefs “should never be confused with permission to use faith as a weapon against those who do not share those beliefs.”

A few people spoke in favor of the bill. Jill Glover, a Christian counselor, said that professionals should be allowed to choose clients with similar values to their own without fear of losing their licenses.

After the hearing the committee voted to advance SB 17 in a 7-1 vote. All the Republicans on the committee and state senator Eddie Lucio Jr. (D) voted in favor of the bill, and state senator Judith Zaffirini (D) voted against it.

According to a Trinity University study of 500 LGBTQ people in Texas, around 10% of LGBTQ Texans struggle to access health care. 42% of those cases involve a struggle to find good health care providers.

One respondent in the study was a transgender woman who said that an ER doctor refused to treat her because she wasn’t wearing pants.