Trying to fix endless pagination problem