Connect handler checks for connection