Add "sort -u" and triple validation