Fix bug of reconnect