tweaking upgrade script