Adding support for handling duplicate records