fixed issue #6, added test case