fixes the pagination helper