In his daily press briefing on Monday, White House spokesperson Sean Spicer suggested that President Trump canceled a vote on the Republican plan to replace Obamacare because it was a “bad deal” that was “not going to be keeping with the vision that he had.”

But Trump was trying to get House Republicans to vote for the bill until the very last minute, even though it never lived up to his promises on the campaign trail to cover everyone and do it cheaply.

Asked by NBC’s Kristen Welker about Trump’s ability to work with Freedom Caucus Republicans on future pieces of legislation, Spicer responded with the following:

I think the president learned a lot through this process. And one of the things that's interesting is, when you look back — and I know there's been a lot to make of this — but the president also recognizes that when there's not a deal to be made, when to walk away. It's not just about making deals, it's about knowing when to walk away from deals and knowing when there's a bad deal that's the only solution. And I think the president understood that while you can get a deal at the time, that sometimes a bad deal is worse than getting a deal. And I think he smartly recognized that what was on the table was not going to be keeping with the vision that he had, and so he decided that this was not the time and that a deal was not at hand.

Early on, the Trump administration didn’t direct the push for the replacement plan, and Trump himself seemed vague on the bill’s particulars. But, as the bill began to falter, Trump met with House Republicans to try to strong-arm them into supporting the plan. As recently as Friday morning before the bill was pulled, Trump was still in support:

After seven horrible years of ObamaCare (skyrocketing premiums & deductibles, bad healthcare), this is finally your chance for a great plan! — Donald J. Trump (@realDonaldTrump) March 24, 2017

Even when it was clear that House Speaker Paul Ryan didn’t have the votes to pass the plan, Trump was still insisting on a congressional vote. Maybe the president only decided it was a “bad deal” once it was clear that it would fail.