make uasorter more robust