fixed a bug where group by would end up using stale data if `replaceData()` was called prior