automatic document regeneration