regenerates the pagination when filtering