Add local storage functionality to keep state.