fixed issue #5
fixed issue #8