logEvent fn working