diff --git a/src/dht.cpp b/src/dht.cpp
index 901655bef197da97f98ebaf6e8ee3b6e053729e9..49e21a665cfa3d57c4718316c408f3628cc58523 100644
--- a/src/dht.cpp
+++ b/src/dht.cpp
@@ -1267,9 +1267,8 @@ Dht::storageStore(const InfoHash& id, const Sp<Value>& value, time_point created
 {
     const auto& now = scheduler.time();
     created = std::min(created, now);
-    auto expiration = created + getType(value->id).expiration;
-
-    if ( expiration < now )
+    auto expiration = created + getType(value->type).expiration;
+    if (expiration < now)
         return false;
 
     auto st = store.find(id);