proposed fix for issue #22