add event tracker and cleanup