change upgrade function