Write to file and dups finished