adding requestAnimationFrame