Update save and delete function