fixed the javascript