fix issue #640