fix for issue #365