Republicans must learn from the election mistake on immigration