Fixed pagination issue

Fixed issue with the pagination.