fixing bugs after merge