add document and change atomic setting method