Update last_modes when keepmodes is set on or off