Use gevent to prevent threading issues