Added a recovering function to read message.