Fixed an issue with pagination