some repairs in javascripts