Added requestAnimationFrame fallback function