Fixed onAnimationComplete being called one animation frame too late