added network dectection