requsetAnimationFrame of animate instead of just calling it