Former President Barack Obama told Prince Harry in an interview broadcast on Wednesday that people in leadership roles must be careful when using social media and warned against spending too much time absorbed in the internet at the expense of the world outside.

“All of us in leadership have to find ways to recreate a common space on the internet,” he said. “One of the dangers of the internet is people can have entirely different realities. They can be just cocooned in information that reinforces their current biases.”

Obama’s response could be viewed as a way of addressing Trump’s tendency for attacking media outlets, while also sharing hateful, unverified information on his Twitter page. He felt peaceful the day he left the White House at the end of his second four-year term, despite a large amount of work that remained unfinished. He said it was “hugely liberating” to be able to set his own agenda in the morning to have the time to talk with his wife, Michelle, now that he is no longer president. In a brief live segment at the end of the show, Harry said he did not know if Obama would be on the guest list for his wedding in May to American actress Meghan Markle. The Sun newspaper has suggested that the British government is concerned that Harry and Markle may invite the Obamas but not Trump, possibly straining ties between the two governments.