JS error correction