Fix undefined variable in save_updates