fix event handler