a bit more stable, but still not looping as I want