The Supreme Court announced Monday that it will review President Trump’s executive order suspending entry of immigrants from six majority-Muslim countries into the United States — or the “travel ban,” as the president prefers to call it. At the same time, the justices announced that they will allow the president to enforce much of the order before they hear the merits of the case.

This decision is a setback for opponents of the ban, implying that the court is skeptical of the argument against parts of it. But the decision may not be a total loss: Because the court allowed the ban to go into effect only against applicants who have few ties to the United States, the court may decide to protect those immigrants with close ties to the country.

In 1965, Congress passed the Immigration and Nationality Act, which was designed to protect certain immigrants — those sponsored by family members in the United States or employers — from the exact type of discrimination in Trump’s executive order. Indeed, the law states that — except in narrow exceptions not relevant here — no person shall “be discriminated against in the issuance of an immigrant visa” due to their “nationality, place of birth or place of residence.”

The Trump administration argues that the president has the power to bar the entry of foreigners deemed “detrimental” to the United States, as per a law passed in 1952. But Congress subsequently amended that law to rule out this type of discrimination. Indeed, the entire purpose of the 1965 law was, as the committee that wrote the bill said, to amend the 1952 law, which “deliberately discriminates against many of the peoples of the world.” Congress also considered and rejected the notion that restricting the power of the president to discriminate against “detrimental” immigrants would allow poorly vetted people to come to the United States.

The order does create a waiver process for visas for immigrants with U.S. relationships, but the U.S. Court of Appeals for the 9th Circuit struck down those parts of the order because it discriminated against immigrants in violation of the 1965 statute. The Supreme Court’s decision to block those same parts of the order leaves open the possibility that some justices sympathize with this view.

The Supreme Court does, however, appear to question the case against the ban as applied to people without U.S. ties. It should not. The 1952 law requires that the president find that a certain class of aliens “would be detrimental” to the interests of the United States. The president failed this basic task.

As the 9th Circuit also concluded, the president never explained why the entry of these specific nationals “would be” detrimental. The administration claims that the vetting process for these nationals may have “possible weaknesses,” but the president never found that the vetting is in fact failing and, therefore, would allow “detrimental” people to enter the country.

But a hypothetical problem is not good enough under the law. As the appeals court noted, the government never cited any evidence — or claimed any secret evidence — that suggested a threat from these nationals. Given that no national from these countries has carried out a deadly terrorist attack in the United States in four decades, the relevant evidence may simply not exist.

The president needs to issue an actual “finding” that immigrants of these nationalities would be detrimental if allowed to enter. It is not good enough for him simply to recite the law’s words and assert without explanation that certain foreigners are detrimental. Otherwise, the president would be free to rewrite all immigration law as he wished, violating the basic principle that Congress cannot delegate its legislative authority to the executive.

The Supreme Court’s decision implies that the ban’s opponents may have an uphill battle on these points. But they could win a narrower victory for those with U.S. sponsors, and the fact that they have finally made it to the Supreme Court will give them the opportunity to make the justices deal directly with the letter of the law.