Pagination fix for empty dataset