Better connection check