added js error logging in log method