revised fix for github issue #8