added js error reporting