added tree check