Fixed issue with onAnimationEnd.