Prevent files from being overwritten

Instead of write, use append. But the file needs to be deleted first