Add upgrade function.