adding handling for invalid color