Fix pagination for filtered results