added cancelAnimationFrame usage