message send and read function