update document after prediction