fixing bugs after last commit