fix the js error validation