bugfix and add test case
update