use sort -u instead of sort | uniq