Fixing reconnection bug