change to animate on requestanimationframe