Update before ending.