Update the whole document