checking of network availability added