fixing sort