added ability to pass in event emitter