broken javaScript fix

fixed errors