fix error handling
coloring simplification