new function to load metadata