overwrite not always defined

Add the local variable 'overwrite' with a default value.