added some anti-glitch behaviors