Trump’s appointment of Matthew Whitaker as acting attorney general may have strengthened Robert Mueller’s position as special counsel. Each new revelation establishing Whitaker’s unfitness for the AG post generally, and his bias regarding Mueller’s investigation specifically, diminishes Whitaker’s and Trump’s ability to obstruct the investigation. Because Trump so obviously selected Whitaker because of his willingness to tank the investigation, as shown by Whitaker’s public statements, all eyes are on Whitaker, alert for the slightest move to curtail Mueller’s work. Indeed, distrust of Whitaker has stiffened the spines of Republican senators, who now support legislation to protect Mueller. Once again, the breathtaking incompetence of the Trump administration has blunted its attack on the rule of law.

As an initial matter, controversy has swirled around the constitutionality of appointing Whitaker, who did not serve in a Senate-confirmed position at the time of his appointment. Neal Katyal and George Conway launched the argument – since supported by scholars spanning the ideological spectrum – in a New York Times op-ed that Article II of the Constitution limits Trump to the appointment of a Senate- confirmed official to fill the AG job on an acting basis. Their argument holds that principal officers who answer directly to the president must be Senate-confirmed and the attorney general is a principal officer, whether acting or permanent. That reading would render unconstitutional the portion of the Vacancies Reform Act (VRA) that Trump relied on. Other scholars argue that an acting appointee does not become a principal officer since the appointment is temporary and under limited circumstances. The Justice Department’s Office of Legal Counsel issued an opinion on Wednesday in support – predictably – of the appointment, relying heavily on history.

Progressives have reason to distrust formulaic resolutions to constitutional issues that neglect historical practice and the desirability, when possible, of interpreting the Constitution to preserve the effective functioning of government. There are times – as in the beginning of an administration or in smaller agencies – when Senate-confirmed officials are in short supply and the most qualified acting candidates work in non-Senate-confirmed positions in the agency. The issue is now joined in court, but may not be decided until Whitaker is long gone.

Whether constitutional or not, Trump’s appointment of Whitaker is an outrage that places an inexperienced crackpot in charge of the massive law enforcement machinery of the federal government and insults the professionals in the Justice Department. While Whitaker served four years as U.S. Attorney in the Southern District of Iowa, his career before and after that period consists of small-time legal practice, political activity, and suspect business dealings. He served on the board of a scam outfit that was fined $25 million before it folded and is now under criminal investigation. He also walked away from a commitment to build low-income housing, ran a concrete business, and owned a day-care center. He has endorsed crackpot beliefs (only people of faith with a biblical view of justice should be judges) and gained Trump’s notice by denying Russian interference in the 2016 election and denouncing the legitimacy of Mueller’s investigation. Reports suggest White House staffers were surprised when they learned some details of Whitaker’s background in the press. Competent vetting could have spared everyone involved considerable embarrassment and produced a more effective appointment.

The combination of constitutional uncertainty surrounding Whitaker’s appointment and his palpable unfitness to serve as attorney general highlights the obvious fact that Trump selected him to curtail the Mueller investigation. It also makes it impossible for him to do so. He is in a severely weakened, closely watched position, in which his survival depends on playing it safe. And he knows a Democratic House majority will intensify the scrutiny of his every step. Limitations on Mueller that Rod Rosenstein might have imposed successfully will be viewed as attacks on Mueller because of Whitaker’s taint.

His appointment spurred new support for legislation to protect Mueller by requiring cause for his firing and authorizing prompt judicial review. Sen. Jeff Flake (R-AZ) announced that he would not vote to support the 21 judicial nominees pending in the Senate Judiciary Committee or the 32 awaiting floor action unless Majority Leader McConnell allowed a vote on the Mueller bill. McConnell appears steadfast in his refusal to do so, secure in the knowledge that Flake will be gone come January. Once again, Jeff Flake invites praise for a tardy feint at responsible behavior that will fail, but his effort deserves support.

The new Congress should amend the Vacancies Reform Act in two ways. First, it should clarify that the president may not fire an official and replace her with an acting official outside the established line of succession. Congress should make explicit that the president can exercise discretion to pick an acting official not in the line of succession only if the vacancy occurs because of unavailability not caused by termination. That would prevent the president from firing officials for the purpose of replacing them with loyalists from within the agency, as he did with Whitaker, or with Senate-confirmed officials from other agencies (Attorney General Betsy DeVos!). Rather, following a termination, the president should be required to accept the official in the prescribed line of succession as the acting replacement.

In addition, Congress should amend the law to require that the president appoint a Senate-confirmed official to act in a principal officer position if one is available in the relevant agency. That would mean that Whitaker could not be appointed ahead of Rosenstein or other Senate-confirmed officials in the Justice Department. Unless the Supreme Court determines that the Constitution so requires, the president should not have to search outside the agency for a Senate-confirmed official. It would be far better to appoint a career Justice Department attorney, who is steeped in the law, and relevant norms and issues, as acting Attorney General than to appoint the Senate-confirmed Ben Carson or Wilbur Ross.

Trump’s corruption-driven impetuousness and the incompetence of his administration caused his firing of Jeff Sessions and his appointment of Matthew Whitaker to boomerang. Rather than accomplish his goal of curtailing the Mueller investigation, he has made interference in it less likely. As a collateral benefit, he has exposed glitches in the Vacancies Reform Act that the new Congress should fix as a first order of business. Once again, we should be grateful that Trump’s authoritarian instincts are frustrated by his incompetence.

Bill Yeomans is the Senior Justice Fellow for Justice at Alliance for Justice. He previously taught constitutional law, civil rights, and legislation at American University Washington College of Law. He also served for 26 years in the Department of Justice, where he litigated cases involving voting rights and discrimination in employment, housing, and education, and prosecuted police officers and racially motivated violent offenders before assuming a series of management positions, including acting Assistant Attorney General. For three years, Bill served as Sen. Edward M. Kennedy’s chief counsel on the Senate Judiciary Committee, and has also held positions at AFJ and the American Constitution Society.