fix issue #90 and #91