if (is_string($prefs)) {
            $prefs = json_decode($prefs, true);
        }