Deleting output file in Write if it exists before writing