fixing sort syntax