enhance error management