fix issue #996

fix issue #996