you need to remove the `var wgs = [];` and `ref[prop] = wgs;` for this to work. If not you're reassigning an empty array.