when a switch is selected, when i press on it again, the onToggle function is triggered, which results in calling the desired method again. so is there anyway to over come this ??