added the toggleControl Function