fix switch mode issue