repair changeColor() function