This is confusing. It should check if it is missing. If so, it should initialize to an empty array, then add the key.