diff --git a/src/contentScripts/communityConsole/extraInfo/infoHandlers/thread.js b/src/contentScripts/communityConsole/extraInfo/infoHandlers/thread.js
index c44d7f8..6c8fb73 100644
--- a/src/contentScripts/communityConsole/extraInfo/infoHandlers/thread.js
+++ b/src/contentScripts/communityConsole/extraInfo/infoHandlers/thread.js
@@ -1,3 +1,5 @@
+import {waitFor} from 'poll-until-promise';
+
 import {parseUrl} from '../../../../common/commonUtils.js';
 import ThreadModel from '../../../../models/Thread.js';
 import {kViewThreadResponse} from '../consts.js';
@@ -6,7 +8,7 @@
 import ResponseEventBasedInfoHandler from './basedOnResponseEvent.js';
 
 const kIntervalInMs = 500;
-const kTimeoutInMs = 10 * 1000;
+const kTimeoutInMs = 3 * 1000;
 const kCurrentInfoExpiresInMs = kTimeoutInMs * 1.5;
 
 export default class ThreadInfoHandler extends ResponseEventBasedInfoHandler {
@@ -53,20 +55,41 @@
     this.info.messages = nonUpdatedMessages.concat(newMessages);
   }
 
-  async isInfoCurrent(injectionDetails) {
-    const currentPage = this.parseThreadUrl();
-    const isCurrentThread =
-        Date.now() - this.info.timestamp < kCurrentInfoExpiresInMs &&
-        this.info.thread.getId() == currentPage.thread &&
-        this.info.thread.getForumId() == currentPage.forum;
+  async getCurrentInfo(injectionDetails) {
+    return this
+        .getCurrentThreads(injectionDetails, /* checkRecentTimestamp = */ true)
+        .catch(() => {
+          console.debug(
+              `extraInfo: couldn't get updated thread info. Trying to ` +
+              `get the information even if it is old.`);
+          return this.getCurrentThreads(
+              injectionDetails, /* checkRecentTimestamp = */ false);
+        });
+  }
 
+  async getCurrentThreads(injectionDetails, checkRecentTimestamp) {
+    injectionDetails.checkRecentTimestamp = checkRecentTimestamp;
+    const options = this.getWaitForCurrentInfoOptions();
+    return waitFor(
+        () => this.attemptToGetCurrentInfo(injectionDetails), options);
+  }
+
+  async isInfoCurrent(injectionDetails) {
+    const checkRecentTimestamp = injectionDetails.checkRecentTimestamp;
     const isMessageNode = injectionDetails.isMessageNode;
     const messageNode = injectionDetails.messageNode;
 
-    return isCurrentThread &&
+    return (!checkRecentTimestamp || this.isThreadCurrent()) &&
         (!isMessageNode || this.currentThreadContainsMessage(messageNode));
   }
 
+  isThreadCurrent() {
+    const currentPage = this.parseThreadUrl();
+    return Date.now() - this.info.timestamp < kCurrentInfoExpiresInMs &&
+        this.info.thread.getId() == currentPage.thread &&
+        this.info.thread.getForumId() == currentPage.forum;
+  }
+
   parseThreadUrl() {
     const currentPage = parseUrl(location.href);
     if (currentPage === false)
