avoid writing multiple time at once in a same file