fix upgrade scripts