store state in local storage