fix bug issue#12 at first step
add test case for issue#12
current changes for future version