updated getAllBooks function