fixed crash on reconnection