use exit instead of break