fixed a concurrent access when reconnecting