fixed a bug which caused the "unread messages" count to be higher than it actually was