Added checks to switch so will check if that switch is used before sending the commands