correct update logic.