added doLogin method