improved the network status check