Fixed weird pagination bug