enhanced update script (issue #588)