optionally allow overwriting existing files. fixes #1