Updates js error function.