fix bug that error occurred if a node without children. #20