fixed the way the last update is computed