updated to make provider optional in search connection