bug fix and add test code
update readme