Fixing bug of the new messgages showing up in the wrong thread when a th...

Fixing bug of the new messages showing up in the wrong thread when a thread is active.