merged paginating with sorting