added a test case to capture the swap bug