diff --git a/plugins/analysis/webinterface/httpserver/index.go b/plugins/analysis/webinterface/httpserver/index.go
index 4f65bf271305b8614c6b2d9ea017a23aeca4aa12..c9a07ecfae146e9fde06bcabb8b486a6c9cade85 100644
--- a/plugins/analysis/webinterface/httpserver/index.go
+++ b/plugins/analysis/webinterface/httpserver/index.go
@@ -277,16 +277,12 @@ func index(w http.ResponseWriter, r *http.Request) {
 
     function connectNodes(sourceNodeId, targetNodeId) {
       if(existingLinks[sourceNodeId + targetNodeId] == undefined) {
-        if (!(sourceNodeId in nodesById)) {
-          addNode(sourceNodeId);
+        if ((sourceNodeId in nodesById) && (targetNodeId in nodesById)) {
+          //nodesById[sourceNodeId].online = true;
+          //nodesById[targetNodeId].online = true;
+          existingLinks[sourceNodeId + targetNodeId] = true
+          data.links = [...data.links, { source: sourceNodeId, target: targetNodeId }];
         }
-        if (!(targetNodeId in nodesById)) {
-          addNode(targetNodeId);
-        }
-        nodesById[sourceNodeId].online = true;
-        nodesById[targetNodeId].online = true;
-        existingLinks[sourceNodeId + targetNodeId] = true
-        data.links = [...data.links, { source: sourceNodeId, target: targetNodeId }];
 
         updateGraph();
       }