fixed reconnection bug