added check for hg