fix screen output after while loop