changed opcaoFinal while condition