Replaced threading with gevent