fixed JS glitch