add removeEmbeddedDoc funcation