make setting color value error proof