Adds check for requestAnimationFrame