added a global event indicator and log functions