Added login failure checks