Timing and js error