prevent overwriting file after making random flag