implemented error handling for colors