Fix a bug: Exit update loop only when the list was replaced successfully.