fix problem in error reporting