Apply uniq to join between models to remove duplicated records

When joining two models for filtering using fields of the other model it returns duplicated instances of the model we are filtering. To fix this, I added a call to `uniq` method in the join.