added setProvider method on guard.
Merge branch '4.0'