fix for sorting