fixing the javascript