attempting to merge writing of files