fixing sort logic
fix merge conflict