fix event generation