Fixed the add new tree functions