Made node completion code conditional