more test cases & fix the bug found last night