fixed issue #5 + regression test