update function ok