you should initialize them to an empty array. This way, you always have an array, and so don't need the ``isset`` check anymore in ``getMetadata``