after a while for false and after empty foreach and after two ifs