moved unit_key['filename'] to metadata