add detachAnimationEvent function