Add condition to escape duplicates