add logging message
fix corner-case with building trees