fix factory test case