fixed overwrite flag
checks wether file exists