Fixed crash on reconnection