Algorithm keeps running, when Remove Edges or Add Nodes is clicked. I want the algorithm to be killed, when button is clicked.