Save state on the client