fix tree structuring