add catch connection failure in the parent code