fix for issue #8 and #9

fix for issue #8 and #9