fixed a bug in axis_sort