Native American tribes celebrated the U.S. Supreme Court’s rejection of a challenge to the Indian Child Welfare Act on Thursday, even as the justices ruled against them in a more obscure case, finding they are not immune from certain provisions of the U.S. Bankruptcy Code.

Justice Amy Coney Barrett’s decision for the 7-2 majority in Haaland v. Brackeen found that Congress had authority to pass the ICWA and rejected a constitutional challenge to the law’s priorities on placing Native American adoptive children in Native American homes. Justices Clarence Thomas and Samuel Alito Jr. each wrote dissenting opinions.