Added check for duplicate insert entries