Created Functions to perform dup check and url replace