(CN) – The Trump administration on Friday filed an appeal in federal court in Maryland in a bid to save the second version of the president’s travel ban.

The revised ban was shut down by judges in Hawaii and Maryland earlier this week after they concluded it, like the administration’s first version, likely it violated the First Amendment by disfavoring a particular religion.

Now, the Trump administration is placing its hopes for the ban in the hands of the Fourth Circuit in Richmond, Virginia.

The Justice Department’s decision to file its appeal in Maryland is seen as bid to avoid having the case heard by the Ninth Circuit, which would have handled an appeal of the order out of Hawaii.

The Ninth Circuit previously ruled against the first version of the White House order suspending the U.S. refugee program and temporarily barring visitors from seven majority Muslim countries – Libya, Iran, Iraq, Sudan, Somalia, Syria, and Yemen.

A three-judge panel found that executive order violated the due process rights of people who had previously been approved to visit the United States.

The Trump administration responded by drafting a new version of the executive order, dropping Iraq from the list of countries and exempting holders of valid visas and green cards.

In the Maryland case, U.S. District Judge Theodore Chuang said he believes the travel ban is heavy-handed attempt to screen members of a particular religious group, rather than a tool to bolster national security — the administration’s stated goal in adopting the policy.

“The fact that the White House took the highly irregular step of first introducing the travel ban without receiving the input and judgment of the relevant national security agencies strongly suggests that the religious purpose was primary, and the national security purpose, even if legitimate, is a secondary post hoc rationale,’’ the judge wrote.