resolve issue #77 and PR #32