Ensuring update is done even in case of an error.