Resolve state error when animation occurs