Adding polyfill for requestAnimationFrame