Store unique id in state.