resovled a null pointer exception in metadata class