Keeping the scope in onAnimationEnd and onTransitionEnd