add test case
add test case and fixing bugs