fix for issue #870