- sort funtion fix