fixing js error