Set provider programmatically

Ive the exact same issue. Even removing prevGrantConfig doesnt change anything…