fixed reconnect bug