update function in