fix a bug due to code upgrading