starting file write out