small improvement on error reporting