minor fix to sort