Added support for network detection