adding unread messages functionality