fixing bug auto replace