Change replace_name function