fix js error when changing text label