fix transaction
add testcase