Added conditional assignment for nodes.