add doc to db