Added an exception for invalid login data