fix event registration