use browser compatible requestAnimationFrame