added function hg_is_tree