Updated to use event detect instead of zmq