Fix integrity constraint error