Fix moving to the last page when clicking the button on the navigation bar when pageSize is equal to 1