fix issue #765