Fix error in pagination helper