added isAnimating check