added login flow handling