Fixed undefined error at end of animation.