cleanup for metadata_client