changed controller for switchcontroller()