small fix for sorting