rebase and fix build