Better way to wait of the task
Solving issue with patching and PutDoc(null key) or PutDoc(identity key)