tree structure fix