fixing bug with case in pagination helper