event handler was not working

fix event handling on init function