ensure metadata folders sorted properly