minor fix for sorting