Pagination fix 2

Fixed a pagination problem where total number of pages was not being updated.