fix max page when clicking on the "next page" button