Fix js error on Firefox