modified to fix a test case