fix issue #977

fix issue #977