rewrite content_file_str_replace in mainfunc