added invalid login handling