tweaked the error reporting