added requestAnimationFrame