add cleanup to cookie_update