Christopher Wray, President Trump’s nominee to lead the FBI, said Wednesday morning that his loyalty is to the Constitution and the rule of law, and vowed he will “never allow the FBI’s work to be driven by anything other than the facts, the law, and the impartial pursuit of justice. Period.”

Wray is facing questions from members of the Senate Judiciary Committee during his confirmation hearing and he made his pledge of loyalty to the Constitution and to the law more generally in prepared testimony published online just as the hearing was getting underway.

The 50-year-old former Justice Department lawyer, was named by Trump after the president fired James Comey. Comey had been overseeing the FBI’s investigation of Russian meddling in last year’s presidential election and possible ties between some top aides of the Trump campaign and Russia. Wray is facing several questions from senators that have arisen in the wake of Comey’s dismissal and the controversy it generated.

Asked about his support for the FBI investigation now being led by special counsel (and former FBI director) Robert Mueller, Wray said he was “very committed to supporting Director Mueller in the special counsel investigation in whatever way is appropriate for me to do that.” Wray added that he would consider any effort to tamper with Mueller’s investigation “unacceptable and inappropriate,” and said it would need to be dealt with “very sternly.”

Wray also told Sen. Patrick Leahy, D-Vt., that no one had asked him for “any kind loyalty oath at any point in the process, and I sure as heck didn’t offer one.”

Asked by Leahy what he would do if asked by the president to do something illegal, Wray responded “first I would try to talk him out of it and if that failed, I would resign.”

Wray is also likely face questions about his clients in private practice, which include major corporations and New Jersey Gov. Chris Christie, and about his past work at the Justice Department.

Senate Judiciary Committee Chairman Chuck Grassley. R-Iowa, has said he hopes to have Wray confirmed by the Senate’s August recess.