implement update function
implement update function