JS error fix