fixed issue #13 and increase test coverage to include this issue