Duplicate key detection