writing metadata to "_metadata"