Adding connection check