sort and pagination working again