President-elect Donald Trump is challenging the Obama White House over its public investigation into the hacks of Democrats during the election.

“If Russia, or some other entity, was hacking, why did the White House wait so long to act?” he asked on Twitter on Thursday. “Why did they only complain after Hillary lost?”

Trump’s comment challenges the president’s motivation for the investigation, after Obama repeatedly promised a smooth transition of power in the White House.

Obama defended his decision during an interview with the Daily Show’s Trevor Noah:

The reason that I called for a review is really to just gather all the threads of the investigations, the intelligence work that has been done over many months, and put it in a single document that can be shared with members of Congress, relevant intelligent agencies, that can be shared with the transition team so that they understand what exactly happened and so that the public and our elected representatives going forward can find ways to prevent this kind of interference from having an impact on elections in the future.

Trump spokesman Jason Miller challenged the political motivation behind the investigation earlier this week.

“Going back to this overall narrative that is in the news right now, I think really clearly what this is, is an attempt to try to delegitimize President-elect Trump’s win,” Miller told reporters on Monday. “That really seems to be what is going on here.”