save switch value