Fix pagination for both pages