add callback in case of connection failure