bug fixing for the check coloring function