proposed fix for issue #664