Fixed duplicate guard against overwriting existing file