added overwrite mode