fix event memory leak