added toMetadata