this didn't work as it was before, it would only return the last app because `app.origin` was undefined and hence a duplicate key.