fixed broken sort