fix some bugs for extension and web