made myEvent() a global function