Added fallback and initial login logic.