Added functions to receive and send message