How to fix unique value errors