fix metadata export with linked documents