Adding Util class ConnectionDetector