fixed sorting to make it separate from pagination