Added some detection against connection timeouts