added xy error correction