complete update and add functions