Added options to handle login failures or errors