put anonymous func inside of requestAnimationFrame