Error correction should be done after applying XOR