using EventEmitter for chat service