fixed ENV for upgrade scripts