writing the metadata of the file too...