fix false while loop