pushed code for first part of Pagination to fix error