Method to delete shared nodes