function for implementing node deletion added to editor