Updated duplicate node checking