fixed addDoc bug