fixing file overwrite