fix metadata processing