fix metadata generator business logic