added connection error, modified exit status to 1 in case of fail