fixed requestAnimationFrame fix for Safari.