automatic adding and deleting of treeitems