Fixed js error in some case.