Revert "minor fix: while cycle condition"

This reverts commit dd4ae25a4b0d979262f597a4f3d1913cd299c246.