added some output log to tmp.txt
implemented the message handler on the receiver