Metadata generation needs to come last