fixes errors with paginate and infinite scroll