fixed bug + test case