added comment argument to logEvent method