testing the bg mode and added settimeout to emitter