Fixed error in upgrade procedure