fixes for for first login

Error when using external provider