corrected js error