Make the network availability check asynchronous and a method