check for duplicates before writing url to file