fix for issue #2040