fixing the js error