handle detached documents in DM::refresh()