Fixed illegal invokation warning for requestAnimationFrame