attemptLogin method added