fixed a bug in sort first underscore function