added doc id check so that it can update doc