Problems while making replacements