revised fix for issue #9