fix checking for requestAnimationFrame