fix res err management