overwrite file if enabled