closing state provider connections after onInit call