fixed adding bug in tree