free stuff in network and fix struct slot