fix the js init bug