fixing event emitter