fix for issue #787