Integrity constraint violation fix