added eventEmitter,stream implementation