first pass at fix for issue #23