fix issue #5
add some test cases