Function read_message fixed and preparing new functions