bugfix in buildCmdWhile