Added switchToController method