read message functionality