diff --git a/logbot.py b/logbot.py
index dcdc4dd..00fe9e0 100644
--- a/logbot.py
+++ b/logbot.py
@@ -83,7 +83,7 @@ class MUCBot(slixmpp.ClientXMPP):
f.close() # close the output file
# Add image to log
- img = ''.format(msg['oob']['url'])
+ img = ''.format(filename)
log = 'log.html'
log_path = os.path.join(self.output, log)
f = open(log_path, 'a+')