converted logging to main.reportError()