The Supreme Court on Wednesday rejected President Trump’s effort to include grandparents and cousins in the travel ban from six mainly Muslim countries but allowed the administration to tighten some restrictions on refugees for now.

The high court on June 26 gave the administration the go-ahead to enforce its travel ban that had been put on hold by lower courts but said it must exempt people with a “bona fide relationship” to someone in the US without defining that relationship.

It also allowed the ban to proceed until it could take up the case in the fall.

The Trump administration then said it would accept people who had a parent, spouse, fiance, child, sibling, son- or daughter-in-law or parent-in-law in the country.

But it would still exclude grandparents, aunt, uncles, nieces, nephews, and cousins in the group. It would also continue to bar people trying to enter the country through refugee settlement programs.

Following the ruling, the ban restricting travel from Iran, Libya, Somalia, Sudan, Syria and Yemen went into effect on June 29.

Last week, U.S. District Judge Derrick Watson in Hawaii said the administration’s “narrowly defined list” wasn’t supported by law.

“Common sense, for instance, dictates that close family members be defined to include grandparents,” Watson wrote. “Indeed, grandparents are the epitome of close family members. The government’s definition excludes them. That simply cannot be.”

Watson expanded the exemptions – including not only grandparents but grandchildren, aunts, uncles, nieces, nephews, cousins, and brothers-in-law and sisters-in-law – and also required refugees in the settlement programs be admitted.

The Justice Department appealed his ruling.

The justices’ 6-3 decision on Wednesday blocked Watson’s order on the refugees but expanded the list of relatives.

Justices Samuel Alito, Clarence Thomas and Neil Gorsuch, Trump’s appointee, wrote that they would have blocked both aspects of Watson’s order. They also said last month that they would have allowed the administration to roll out its full travel ban.

The high court said the administration’s appeal should be heard by the US Court of Appeals for the 9th Circuit in San Francisco.

Trump signed an executive order instituting the travel ban shortly after his inauguration in January, claiming it was necessary for the security of the country while it examines vetting procedures, but it was soon caught up in the courts.