resore state on reconnect