add tree node depth info when building tree