protected function switchTheme(Controller $controller)
    {
        if (!$controller->isInternalRoute()) {

            try {

                $device = $this->getDeviceType();
                $store_id = $controller->getStoreId();
                $settings = $this->module->getSettings('device');

                if (!$controller->isBackend() && $device !== 'desktop' && !empty($settings['theme'][$store_id][$device])) {
                    $theme = $settings['theme'][$store_id][$device];
                    if ($this->module->isEnabled($theme)) {
                        $controller->setCurrentTheme($theme);
                    }
                }

            } catch (Exception $ex) {
                trigger_error($ex->getMessage());
            }
        }
    }