Updated tag list retrieval to use distinct sql statement