fixing multiple requestanimationframes