fix issue #870