fixing the pagination for export