diff --git a/src/account.cpp b/src/account.cpp
index 389312a9ec39dffd4238e02856873b3ebb7c8451..f24d1f1bc008f91731d7cc9cb5fb6b3c28298869 100644
--- a/src/account.cpp
+++ b/src/account.cpp
@@ -448,8 +448,6 @@ Account::mapStateNumberToString(RegistrationState state)
         CASE_STATE(ERROR_NETWORK);
         CASE_STATE(ERROR_HOST);
         CASE_STATE(ERROR_SERVICE_UNAVAILABLE);
-        CASE_STATE(ERROR_EXIST_STUN);
-        CASE_STATE(ERROR_NOT_ACCEPTABLE);
         CASE_STATE(ERROR_NEED_MIGRATION);
         CASE_STATE(INITIALIZING);
     default:
diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp
index aa11d4a876ffcd0e7a30732d0f704cb26baf006f..cab84c4792bc4b0b35e639d368f4fcb74108d513 100644
--- a/src/jamidht/jamiaccount.cpp
+++ b/src/jamidht/jamiaccount.cpp
@@ -2347,9 +2347,7 @@ void
 JamiAccount::doUnregister(std::function<void(bool)> released_cb)
 {
     std::unique_lock<std::recursive_mutex> lock(configurationMutex_);
-
-    if (registrationState_ == RegistrationState::INITIALIZING
-        || registrationState_ == RegistrationState::ERROR_NEED_MIGRATION) {
+    if (registrationState_ >= RegistrationState::ERROR_GENERIC) {
         lock.unlock();
         if (released_cb)
             released_cb(false);
diff --git a/src/registration_states.h b/src/registration_states.h
index abc66a6e96146ecbfeadf8341afdb3bc54607be4..d4c4aa248e40b67d352dd5e4951b8f36dead1b95 100644
--- a/src/registration_states.h
+++ b/src/registration_states.h
@@ -38,8 +38,6 @@ enum class RegistrationState {
     ERROR_NETWORK,
     ERROR_HOST,
     ERROR_SERVICE_UNAVAILABLE,
-    ERROR_EXIST_STUN,
-    ERROR_NOT_ACCEPTABLE,
     ERROR_NEED_MIGRATION,
     INITIALIZING
 };