update from Cloudwu's github project