cancelAnimationFrame fix