Avoid selecting same node twice while connecting