Fix event trigger bug