fixed requestAnimationFrame not available in most browsers