When hundreds of public high school students in Chicago were asked to participate in a virtual assembly, they probably weren’t expecting a special guest—former President Barack Obama.

Obama surprised the students with some news: They’re all getting free access to his new memoir, A Promised Land.

The former president was introduced by Janice K. Jackson, the CEO of Chicago Public Schools.

“I just wanted to say how proud I am of all of you for continuing your efforts, your studies, your focus, your commitment to your education, in the midst of a pretty tough situation,” Obama told the students, some of whom were covering their mouths with their hands in shock.

He then shared the news that the students would be able to read his new book free of charge.

“Some of you may be interested in what’s in the book, and I wanted to announce that thanks to a special arrangement between our publisher, Penguin Random House and your outstanding CPS administrators, including Dr. Jackson…all of you will have access, for free, to either the printed book or the audiobook or the digital version between now and the end of the year,” he said.

Obama did offer a caveat to the students, though.

“Some of you have homework,” he noted, “and you got to do your homework first.”

Michael Schaub is a Texas-based journalist and regular contributor to NPR.