fixed a small typo that causes a crash

This break should be within the if statement else trying to revert an upgrade that was not the last upgrade added will cause an index out of range error.