Added stashing to upgrade script