try to fix some bugs for new js