Fix bad bug where writing into same directory over batch of jobs