fix bugs for abort when fail to connect server in Mac