How to restart switches when failure occurs