fixed bugs after merge