updated readMessage so it's only called when there are unread messages