terminate process when connect fails