changeModi/changeState loop fixed