fix the javascript bug