add code for modifying rules after deleting a node