add 'send/receive message' function