fixed order of writing files