make copyTree() work