change quit -> while