Lesbian, gay, bisexual, and transgender (LGBT) people planning on fostering or adopting children in the US have a victory to celebrate.

The US House of Representatives approved an appropriations package for the Departments of Labor, Health and Human Services, Education, and Defense on Wednesday – but only after a discriminatory amendment was removed. That amendment would have allowed child welfare providers to refuse to place children with LGBT parents.

The “Aderholt Amendment,” introduced by Rep. Robert Aderholt (R-AL), would have forced the federal government to fund adoption and foster care agencies that discriminate against LGBT people for “religious” or “moral” reasons by refusing them services.

In July, an appropriations committee in the House unexpectedly inserted the Aderholt Amendment into the funding package.

Human Rights Watch expressed alarm about the harm this amendment would inflict on LGBT parents seeking to foster or adopt children and joined with hundreds of other organizations to oppose the amendment. Our research has documented how these types of religious or moral exemptions function as a “license to discriminate,” allowing providers to turn away LGBT people, deterring LGBT people from seeking out services, and violating the dignity of LGBT people. These exemptions also jeopardize children’s rights, and unduly limit children’s chances of being placed with loving, qualified parents.

Following the House vote, the US Senate passed its own appropriations bill without this discriminatory amendment. Finally, the Aderholt Amendment was excluded from the conference report reconciling the House and Senate versions, and effectively died when the House agreed to that report on Wednesday.

While the defeat of the Aderholt Amendment is a positive development, more work remains to be done. Currently, ten US states – Alabama, Kansas, Michigan, Mississippi, North Dakota, Oklahoma, South Carolina, South Dakota, Texas, and Virginia – have laws in place that are similar to the Aderholt Amendment. By contrast, only three states and the District of Columbia prohibit discrimination in foster care based on sexual orientation and gender identity, and five more states prohibit discrimination based on sexual orientation alone.

In the upcoming year, lawmakers at the federal and state levels should reject these licenses to discriminate and strengthen nondiscrimination protections so that no loving, qualified parents are turned away solely because of who they are.