increasing the performance of checkout_duplicate by using a hash table.