fix issue #1247