Fixing cursor use in Pagination