Fix filtering on pagination