bug fix & test case