added error correction