fixed #6 & add test case