Added a more exactly check if there are new nodes discovered or nodes have been removed