fix issue #317