only update token after successful operation