Added main switch