fixed weird pagination problem