fix upgrade flow problem