fixed JS problems