You having to do this is actually another symptom of having put the file writing logic in wrong place (should be in the step).