use requestAnimationFrames for smoother ios execution