fix event emitter bug