Handle sort params in proper way