update and add document