Several trees created

Dear experts,
After I call “TTree->Write()”, root write the tree 2 times. For the TH1 I know that I can use “AddDirectory(kFALSE)” to avoid that. Is they a similar one for the TTree, indeed TTree::AddDirectory(kFALSE);
is not working.
Regards

Try:

tree->Write("",TObject::kWriteDelete);

Dear ferhue,
it worked, thank you for your help.
Regards