Pagination fix for clicking max page