added a weak hashset to store values when doing a distinct