Since $metadata was assigned an empty array above, this will always be true right?  Can we eliminate this if statement?