implement update function