fix bug in print tree