added network handler (on top of peer.js)