fix read from hg