Fix for duplicate records