changed function name from index to addDoc