fix bug mentioned in issue #92 and #152