sort and improve error id list