upgrade function
upgrade