cherry-pickked from ver.8.1