fixing some JS glitches