fix wrap doc when reloading from DB