pagination sort fix