added switch mode