modify mainfun for rewrite file_str_replace