updates for resiliance of connections and debug output