fix for tree generation