diff --git a/src/Form/UwSearchForm.php b/src/Form/UwSearchForm.php
index 812bf626fb3159b279e5be2de33f3757b275b5a5..2ad1a2a3f39fb813894c93ee2781a71b90128fa0 100644
--- a/src/Form/UwSearchForm.php
+++ b/src/Form/UwSearchForm.php
@@ -94,6 +94,9 @@ class UwSearchForm extends FormBase {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
 
+    // Variable for the parameters.
+    $parameters = '';
+
     // Get the values from the form state.
     $values = $form_state->getValues();
 
@@ -101,9 +104,6 @@ class UwSearchForm extends FormBase {
     // set for the redirect to the search.
     if ($values['search-input'] || $values['search-type']) {
 
-      // Variable for the parameters.
-      $parameters = '';
-
       // If this is a site search, add it to parameters.
       if ($values['search-type']) {
         $parameters .= $values['search-type'] . ' ';