Fixed JS glitch