fix log message in wrong scope