Fix update function.