fix issue #597