fix bugs after merge