Add update function.