Added checking of network state before loading ads