fixed the js bug