fix bug: save the doc after updating its vector