minor fix: while cycle condition