Why restore `modified`? The whole point of this flag is to know whether to serialize to session or not.