with error reporting