working delete for tree