Prevent infinite loop in getBookPage