fix upgrade handler