requestAnimationFrame to help performance