fix event handlers