Pagination is now working correctly