add ancestors in metadata