Added a connection count variable and emitter.