added catches for undefined in metadata