modify file, and remove duplicate.