fix error when creating new tree