fixed issue #771