fixed security hole, noticed bug in network handler