read messages in db