print tree funtion fix