Added login-error handling