hacky fix for gevent compatibility