added network availability check