Update code to avoid js error.