save id and rev