sample: update document title based on state