More doLogin functionality