finished file writeout