fix embedded document bug