added event emitter logic to the looper