fix bugs from rebase