tree history function updated