President Barack Obama defended Director of National Intelligence James Clapper in a new, after Clapper drew fire for giving misleading testimony to Congress about the scope of the National Security Agency’s domestic surveillance programs.

In congressional testimony last year, Clapper answered “no sir” when asked if the NSA collects data on millions of Americans in its domestic surveillance dragnet. When leaks from former NSA contractor Edward Snowden revealed the agency’s bulk collection of data on millions’ of Americans’ phone calls, Clapper defended his testimony by calling it the “least untruthful” thing he could say about classified national security programs in an open hearing.

“I think that Jim Clapper himself would acknowledge, and has acknowledged, that he should have been more careful about how he responded,” Obama told CNN in the interview that aired Friday. “His concern was that he had a classified program that he couldn’t talk about, and he was in an open hearing in which he was asked, he was prompted to disclose a program, and so he felt he was caught between a rock and a hard place.”

Obama acknowledged that the intelligence community has work to do to win back the confidence of the American people.

“As I said in the speech that I gave a couple of weeks ago, what’s clear is that we are going to have to do a better job of being transparent about what we do, to have a robust public debate about what we do,” Obama said. “But it’s going to take some time. It’s going to take some work, partly because the technology has just moved so quickly that the discussions that need to be had didn’t happen fast enough, didn’t happen on the front end.”