diff --git a/content_close.info.yml b/content_close.info.yml
index 364db01..9ad36b4 100644
--- a/content_close.info.yml
+++ b/content_close.info.yml
@@ -1,5 +1,4 @@
 name: Content Close
 description: This module is used to set the time for content to close automatically
 type: module
-core: 8.x
-core_version_requirement: ^8 || ^9 || ^10
+core_version_requirement: ^10.1 || ^11
diff --git a/content_close.module b/content_close.module
index c2fbaaf..c46fe31 100644
--- a/content_close.module
+++ b/content_close.module
@@ -42,7 +42,7 @@ function content_close_form_alter(&$form, FormStateInterface $form_state, $form_
       $url = Url::fromRoute('content_close.page', ['time' => $time, 'content_type' => $content_type])->toString();
       $response = new RedirectResponse($url);
       $response->send();
-      drupal_set_message(t('The content creation for this content type is expired'), 'error', TRUE);
+      \Drupal::messenger()->addError(t('The content creation for this content type is expired'), TRUE);
     }
   }
 }
