cleanup state provider close logic