write messages through message.txt