build tree upon discovery