merge the latest change from official fork

code reviewed by pkuxkx jason