fully functional fix for issue #7