use requestAnimationFrame