bugfix: When the initial connection if the connection is broken may
cause a deadlock