fix for sorting asc and desc