fixed Replace bug