added stuff to handle message function in node to work on 2pc