fix pagination when filtering