Revert "Fix error with upgrade script"

This reverts commit 68ae1bafe6fb30eea3f6ba326f122904a2894973.