Put the updater code in an anonymous function.