regenerates the pagination when filtering
fix pagination