Added option for error reporting