fixed bug for replace_anyway