fixed JS for firefox