see issue #15 and #16
fixed issue #5