working with event emitter.