diff --git a/re6st/cache.py b/re6st/cache.py
index ea331c41ff02f884a6d6ce8a0291ca335261d905..6161a71971d8c9d3846b34f2f89bc89b74e858fc 100644
--- a/re6st/cache.py
+++ b/re6st/cache.py
@@ -201,7 +201,7 @@ class Cache(object):
 
     @property
     def my_address(self):
-        for x, in self._db.execute("SELECT address FROM peer WHERE NOT prefix"):
+        for x, in self._db.execute("SELECT address FROM peer WHERE prefix=''"):
             return x
 
     @my_address.setter