Does this infinitely loop without this check?