fix rebase and add a test case