fixed JS erros