bug fix: When deleting an element, if it does not contain a parent it will not be deleted.