Checking to see if connect it successfully, should exit gracefully