fixed bug in TreeAssemblyFunction