checking unique key now works properly.