Fixed reconnection bug