Fix pagination problem