mend for the bug of sort