fix error use of sort