a common way to resolve the paradox, both in popular literature and part of the academic literature, especially in philosophy, is to assume that the 'a' in step 7 is intended to be the expected value in envelope a and that we intended to write down a formula for the expected value in envelope b.