Kevin McAleenan, the acting secretary of the Department of Homeland Security, told lawmakers he will remain in his job “if necessary” despite his plans to step down Thursday because the president has yet to name his replacement.

McAleenan submitted his resignation to President Trump on Oct. 11, but Trump has not announced his nominee to take over DHS, the nation’s third-largest federal agency, with 240,000 employees. At the conclusion of a House subcommittee hearing Wednesday on global terrorism threats, Homeland Security Committee Chairman Bennie Thompson (D-Miss.) asked McAleenan if he was prepared to stay in the job until Trump finds a new secretary.

“I hope a plan for the successor is imminent, but if necessary I will stay on to ensure a smooth transition,” McAleenan said.

Co-workers have scheduled a farewell party for McAleenan on Wednesday afternoon at U.S. Customs and Border Protection, where he spent most of his career.

Lawmakers from both parties, as well as current and former DHS officials, say they are bewildered that Trump has moved so slowly to replace McAleenan at the helm of the department responsible for safeguarding the United States from terrorism, cyberattacks, natural disasters and other threats.

Rep. Kathleen Rice (D-N.Y.) asked McAleenan about reports this week that the White House could attempt to rewrite the order of succession at DHS to install hard-liner Ken Cuccinelli at the head of the department, devising an elaborate workaround to rules established by the Vacancies Reform Act.

Cuccinelli, the acting director of U.S. Citizenship and Immigration Services, is a favorite of the president’s, but the Justice Department has told the White House that Cuccinelli is not eligible for the job under current rules.

“In your final hours as acting secretary, do you have any plans to change the current line of succession at DHS?” Rice asked.

McAleenan said he could not discuss “pre-decisional deliberations,” but when pressed by Rice, he told her “I have no plans to do that.”

McAleenan has served in an interim role at DHS since April, when Trump ousted then-secretary Kirstjen Nielsen in frustration with a migration surge at the U.S. southern border.

Under McAleenan, border crossings have fallen by two-thirds, as DHS has restricted access to the U.S. immigration system for asylum seekers and enlisted Mexican authorities to help with the migration crackdown.

Although Trump did not nominate McAleenan for confirmation, the White House has praised his immigration record and demonstrated no urgency to replace him, despite his desire to leave at the end of October.

Senate Majority Leader Mitch McConnell (Ky.) and other GOP senators have indicated they would not vote to confirm Cuccinelli, but some of the president’s supporters are urging the White House to find a way to install him anyway.