diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py
index b9a18ddfd05bca02d73b7097a07201e6f6b0a403..6743556a396a4808faed217873c76d41adf8f7e0 100644
--- a/src/common/connection_handlers_events.py
+++ b/src/common/connection_handlers_events.py
@@ -1103,7 +1103,7 @@ class MessageReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
             msg_ = forwarded.getTag('message')
             to_ = msg_.getAttr('to')
             if to_:
-                gajim.get_jid_without_resource(to_)
+                to_ = gajim.get_jid_without_resource(to_)
             else:
                 to_ = gajim.get_jid_from_account(account)
             frm_ = gajim.get_jid_without_resource(msg_.getAttr('from'))