Move initial setting of $extNode out of the conditional