fixed a wrong cast in gevent plugin