DDF-371 - updated unique function to remove duplicates