save and restore switch settings