fixed go to last page button calculation