Whenever I run the attached code, the instance disconnects and nodes are not deleted. Previously it all worked, just stopped working today.