Save document into app state