Network Connection detection and handling added