removing endeless switch