Unique key error handling