Added code to read network state