fixes logic to work with real switches