fixed crash on reconnect