attach a function to emitter update