added reportError for writing to error console