fix the javascript errors