Adding connection checking