pagination sort of working