changed port_comms to work with erl_marshal