fix for issue #11 and #12