fix the tree node calculation for left and right