fixed sorting of empty values (total row)