updates the pagination to work