fix event flow