updated connection check for error propagations.