updated the javascript