President Obama made his final appearance during Jon Stewart’s reign as host of “The Daily Show” on Tuesday, joking with the Comedy Central pundit that he would issue an executive order to prevent him from leaving the show on Aug. 6.

“I can’t believe you’re leaving before me,” Obama told Stewart, according to a pool report. “I’m going to issue an executive order. Jon Stewart cannot leave the show. It’s being challenged in courts.”

Stewart countered during the half-hour interview that “to me, this is a state’s rights issue.”

Joking aside, Obama spent a large part of his time on the show talking about the nuclear deal with Iran. He said that critics seem to believe “if you had brought Dick Cheney to the negotiations, everything would be fine.”

Obama said that, although Iran would continue to be a problem in the region, “we have taken off the table what would be a catastrophic problem if they got a weapon.”

He also defended the deal by comparing it to the standoff between the United States and the Soviet Union, culminating in arms agreements in the 1980s.

“That posed a much greater threat, and we actually had to give something up,” Obama said. “In this situation, we’re not giving anything up.”

Stewart also asked Obama about media coverage.

“The media are a bunch of different medias,” Obama said. “Some get on my nerves more than others.”

He said that “what I’m most concerned about is not that it’s unfair or too tough on government … but that it gets distracted by shiny objects and doesn’t always focus on the big choices and tough decisions.”

Obama said that the White House was “way too slow” in re-engineering the press office so that it could have “more unconventional” interactions with media, like his appearances on “The Daily Show” or, last week, on HBO’s “Vice.”

He said that with the “balkanization” of the media, “it’s hard for us to get one conversation.”

“How do we join together in common conversation around something other than the Super Bowl?,” Obama asked.

The appearance on “The Daily Show” was Obama’s third as president and seventh overall.