fixed infinite cycle