fixed the login flow be