fix persisters writing temporary writing
be sure to remove the temp file
write into same dir of the targhet file