fix tree reading