fix the bug of using green thread