fix issue with the color mode not being handled correctly