Added more logic around login
New exception flow for login