fixed grayscale bugs