minor change in requestAnimationFrame