check for sorting values