do not give metadata array by reference