fixed switch mode bug