update function. cbbk